<div class="personalinfo">
	<div class="nav">
		<div class="nav-li focus">个人信息</div>
		{{#if !$Cache.personalinfo.is_edit}}
		<div value="true" class="nav-li" event-click="{{'$Event.personalinfo.to_edit'}}">修改</div>
		<a href="#personal/changepwd"><div class="nav-li">修改密码</div></a>
		{{#else}}
		<div value="true" class="nav-li" event-click="{{'$Event.personalinfo.post_edit'}}">完成</div>
		<div value="true" class="nav-li" event-click="{{'$Event.personalinfo.cancel_edit'}}">取消</div>
		{{/if}}
	</div>

	<hr />

	<div class="info_box">
		<div class="table">
		{{#if !$Cache.personalinfo.is_edit}}
			<div class="item">
				<div class="title">头像：</div>
				<div><span class="text"><img bind-src="{{loginer.info.header_url||'/images/logo.png'}}"></span></div>
			</div>
			<div class="item">
				<div class="title">昵称：</div>
				<div><span class="text">{{loginer.info.name}}</span></div>
			</div>
			<div class="item">
				<div class="title">绑定手机：</div>
				<div><span class="text">{{loginer.info.mobile_phone}}</span></div>
			</div>
			<div class="item">
				<div class="title">绑定邮箱：</div>
				<div><span class="text">{{loginer.info.email}}</span></div>
			</div>
			<div class="item">
				<div class="title">身份证：</div>
				<div><span class="text">{{loginer.info.id_card}}</span></div>
			</div>
		{{#else}}
			<div class="item">
				<div class="title">头像：</div>
				<div>
					<span class="text"><img bind-src="{{loginer.info.header_url||'/images/logo.png'}}"></span>
				<img-uploader
					text="选择封面"
					bind-input-key="loginer.info.header_url"
					one-way="true"
					style="display:inline-block;"
					max-width="512"
					>
				</img-uploader>
				</div>
			</div>
			<div class="item">
				<div class="title">昵称：</div>
				<div><span class="text">{{loginer.info.name}}</span></div>
			</div>
			<div class="item">
				<div class="title">绑定手机：</div>
				<div><span class="text"><input type="text" value="{{loginer.info.mobile_phone}}" bind-input="{{'loginer.info.mobile_phone'}}"></span></div>
			</div>
			<div class="item">
				<div class="title">绑定邮箱：</div>
				<div><span class="text"><input type="text" value="{{loginer.info.email}}" bind-input="{{'loginer.info.email'}}"></span></div>
			</div>
			<div class="item">
				<div class="title">身份证：</div>
				<div><span class="text"><input type="text" value="{{loginer.info.id_card}}" bind-input="{{'loginer.info.id_card'}}"></span></div>
			</div>
		{{/if}}
			
		</div>
	</div>
</div>
<xmp type="template" name="personalinfo.id_card">
	<span>{{$Private.id_card}}</span>
</xmp>
<script type="text/vm" name="personalinfo.id_card">
	function (vm) {
		vm.set("$Private.id_card",Model.Observer(function () {
			var id_card = vm.get("$This")||"";
			// console.log("id_card:",id_card);
			// 350623 199211 270018
			return id_card.substr(6)+"******"+id_card.substr(6);
		}));
		// debugger
		vm.model.onfollow = function () {
			debugger
			vm.get("$Private.id_card");
			vm.model.touchOff("$Private.id_card");
		}
	}
</script>